function toastSuccess(that,msg,onclose=function(){}){
	console.log(msg);
	that.$message.success({title: '成功',message: msg,duration:2000,onClose:onclose});
}
function toastError(that,msg,onclose=function(){}){
	that.$message.error({title: '失败',message: msg,duration:2000,onClose:onclose});
}

/**
 * 获取电脑操作系统
 * @returns
 */
function getOsSys()
{
	var os = navigator.platform;
    var userAgent = navigator.userAgent;
    var info=new Array()
    var tempArray  = "";
    if(os.indexOf("Win") > -1){
        if(userAgent.indexOf("Windows NT 5.0") > -1){
            info[0] = "Win2000";
        }else if(userAgent.indexOf("Windows NT 5.1") > -1){
            info[0] =  "WinXP";
        }else if(userAgent.indexOf("Windows NT 5.2") > -1){
            info[0] =  "Win2003";
        }else if(userAgent.indexOf("Windows NT 6.0") > -1){
            info[0] =  "WindowsVista";
        }else if(userAgent.indexOf("Windows NT 6.1") > -1 || userAgent.indexOf("Windows 7") > -1){
            info[0] =  "Win7";
        }else if(userAgent.indexOf("Windows 8") > -1){
            info[0] =  "Win8";
        }if(userAgent.indexOf("Windows NT 10.0") > -1) {
        	info[0] =  "Win10";
        } else{
            info[0] =  "Other";
        }
    }else if(os.indexOf("Mac") > -1){
        info[0] =  "Mac";
    }else if(os.indexOf("X11") > -1){
        info[0] =  "Unix";
    }else if(os.indexOf("Linux") > -1){
        info[0] =  "Linux";
    }else{
        info[0] =  "Other";
    }

    if(/[Ff]irefox(\/\d+\.\d+)/.test(userAgent)){
        tempArray = /([Ff]irefox)\/(\d+\.\d+)/.exec(userAgent);
        info[1] =  tempArray[1] + tempArray[2];
    }else if(/MSIE \d+\.\d+/.test(userAgent)){
        tempArray = /MS(IE) (\d+\.\d+)/.exec(userAgent);
        info[1] =  tempArray[1] + tempArray[2];
    }else if(/[Cc]hrome\/\d+/.test(userAgent)){
        tempArray = /([Cc]hrome)\/(\d+)/.exec(userAgent);
        info[1] =  tempArray[1] + tempArray[2];
    }else if(/[Vv]ersion\/\d+\.\d+\.\d+(\.\d)* *[Ss]afari/.test(userAgent)){
        tempArray = /[Vv]ersion\/(\d+\.\d+\.\d+)(\.\d)* *([Ss]afari)/.exec(userAgent);
        info[1] =   tempArray[3] + tempArray[1];
    }else if(/[Oo]pera.+[Vv]ersion\/\d+\.\d+/.test(userAgent)){
        tempArray = /([Oo]pera).+[Vv]ersion\/(\d+)\.\d+/.exec(userAgent);
        info[1] =   tempArray[1] + tempArray[2];
    }else{
        info[1] =  "unknown";
    }
    return info;
}
//生成从minNum到maxNum的随机数
function randomNum(minNum,maxNum){ 
    switch(arguments.length){ 
        case 1: 
            return parseInt(Math.random()*minNum+1,10); 
        break; 
        case 2: 
            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
        break; 
            default: 
                return 0; 
            break; 
    } 
} 